package com.rh.number.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@JsonIgnoreProperties(ignoreUnknown = true)
public class FilterParam {
    // 设置默认值为空列表
    @JsonProperty("targetFields")
    private List<String> targetFields = new ArrayList<>();
    @JsonProperty("currentFilters")
    private Map<String, String> currentFilters = new HashMap<>();

    // 保证始终返回非null值
    public List<String> getTargetFields() {
        return targetFields != null ? targetFields : new ArrayList<>();
    }

    public Map<String, String> getCurrentFilters() {
        return currentFilters != null ? currentFilters : new HashMap<>();
    }
    public void setTargetFields(List<String> targetFields) { this.targetFields = targetFields; }


}
